Methods and systems for developing data flow programs

ABSTRACT

Methods, systems, and articles of manufacture consistent with the present invention provide a development tool that enables computer programmers to design and develop a data flow program for execution in a multiprocessor computer system. The tool allows the programmer to define a region divided into multiple blocks, wherein each block is associated with data operated on by code segments of the data flow program. The development tool also maintains dependencies among the blocks, each dependency indicating a relationship between two blocks that indicates that the portion of the program associated with a first block of the relationship needs the resultant data provided by the portions of the program associated with a second block of the relationship. The development tool supports several debugging commands, including insertion of multiple types of breakpoints, adding and deleting dependencies, single stepping data flow program execution, and the like.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of Ser. No. 10/005,783, filed Nov. 8,2001, which is a Continuation-In-Part of Ser. No. 09/244,138, filed Feb.4, 2001, now U.S. Pat. No. 6,378,066.

The entirety of each of the above identified patent applications areincorporated herein by reference to the extent permitted by law.

FIELD OF THE INVENTION

This invention relates to the field of multiprocessor computer systemsand, more particularly, to data driven processing of computer programsusing a multiprocessor computer system.

BACKGROUND OF THE INVENTION

Multiprocessor computer systems include two or more processors thatexecute the instructions of a computer program. One processor executes aparticular set of instructions while other processors execute differentsets of instructions.

Fast computer systems, like multiprocessor computer systems, havestimulated the rapid growth of a new way of performing scientificresearch. The broad classical branches of theoretical science andexperimental science have been joined by computational science.Computational scientists simulate on supercomputers phenomena toocomplex to be reliably predicted by theory and too dangerous orexpensive to be reproduced in a laboratory. Successes in computationalscience have caused demand for supercomputing resources to rise sharplyin recent years.

During this time, multiprocessor computer systems, also referred to as“parallel computers,” have evolved from experimental designs inlaboratories to become the everyday tools of computational scientistswho need the most advanced computing resources to solve their problems.Several factors have stimulated this evolution. It is not only that thespeed of light and the effectiveness of heat dissipation impose physicallimits on the speed of a single processor. It is also that the cost ofadvanced single-processor computers increases more rapidly than theirpower. And price/performance ratios become more favorable if therequired computational power can be found from existing resourcesinstead of purchased. This factor has caused many sites to use existingworkstation networks, originally purchased to do modest computationalchores, as “SCAN”s (SuperComputers At Night) by utilizing theworkstation network as a parallel computer. This scheme has proven sosuccessful, and the cost effectiveness of individual workstations hasincreased so rapidly, that networks of workstations have been purchasedto be dedicated to parallel jobs that used to run on more expensivesupercomputers. Thus, considerations of both peak performance andprice/performance are pushing large-scale computing in the direction ofparallelism. Despite these advances, parallel computing has not yetachieved widespread adoption.

The biggest obstacle to the adoption of parallel computing and itsbenefits in economy and power is the problem of inadequate software. Theprogrammer of a program implementing a parallel algorithm for animportant computational science problem may find the current softwareenvironment to be more of an obstruction than smoothing the path to useof the very capable, cost-effective hardware available. This is becausecomputer programmers generally follow a “control flow” model whendeveloping programs, including programs for execution by multiprocessorcomputer systems. According to this model, the computer executes aprogram's instructions sequentially (i.e., in series from the firstinstruction to the last instruction) as controlled by a program counter.Although this approach tends to simplify the program developmentprocess, it is inherently slow.

For example, when the program counter reaches a particular instructionin a program that requires the result of another instruction or set ofinstructions, the particular instruction is said to be “dependent” onthe result and the processor cannot execute that instruction until theresult is available. Moreover, executing programs developed under thecontrol flow model on multiprocessing computer systems results in asignificant waste of resources because of these dependencies. Forexample, a first processor executing one set of instructions in thecontrol flow program may have to wait for some time until a secondprocessor completes execution of another set of instructions, the resultof which is required by the first processor to perform its set ofinstructions. Wait-time translates into an unacceptable waste ofcomputing resources in that at least one of the processors is idle thewhole time while the program is running.

To better exploit parallelism in a program some scientists havesuggested use of a “data flow” model in place of the control flow model.The basic concept of the data flow model is to enable the execution ofan instruction whenever its required operands become available, andthus, no program counters are needed in data-driven computations.Instruction initiation depends on data availability, independent of thephysical location of an instruction in the program. In other words,instructions in a program are not ordered. The execution simply followsthe data dependency constraints.

Programs for data-driven computations can be represented by data flowgraphs. An example data flow graph is illustrated in FIG. 1 for thecalculation of the following expression:z=(x+y)*2

When, for example, x is 5 and y is 3, the result z is 16. As showngraphically in the figure, z is dependent on the result of the sum of xand y. The data flow graph is a directed acyclic graph (“DAG”) whosenodes correspond to operators and arcs are pointers for forwarding data.The graph demonstrates sequencing constraints (i.e., constraints withdata dependencies) among instructions.

For example, in a conventional computer, program analysis is often done(i) when a program is compiled to yield better resource utilization andcode optimization, and (ii) at run time to reveal concurrent arithmeticlogic activities for higher system throughput. For instance, considerthe following sequence of instructions:P=X+Y   1Q=P/Y   2R=X*P   3S=R−Q   4T=R*P   5U=S/T   6

The following five computational sequences of these instructions arepermissible to guarantee the integrity of the result when executing theinstructions on a serial computing system (e.g., a uniprocessor system):

1, 2, 3, 4, 5, 6

1, 3, 2, 4, 5, 6

1, 2, 3, 5, 4, 6

1, 3, 2, 5, 4, 6

1, 3, 5, 2, 4, 6

For example, the first instruction must be executed first, but thesecond or third instruction can be executed second, because the resultof the first instruction is required for either the second or thirdinstruction, but neither the second nor the third requires the result ofthe other. The remainder of each sequence follows the rule that noinstruction can be executed until its operands (or inputs) areavailable.

In a multiprocessor computer system with two processors, however, it ispossible to perform the six operations in four steps (instead of six)with the first processor computing step 1, followed by both processorssimultaneously computing steps 2 and 3, followed by both processorssimultaneously steps 4 and 5, and finally either processor computingstep 6. This is an obvious improvement over the uniprocessor approachbecause execution time is reduced.

Using data flow as a method of parallelization will thus extract themaximum amount of parallelism from a system. Most source code, however,is in a control form, which is difficult and clumsy to parallelizeefficiently for all types of problems.

It is therefore desirable to provide a facility for programmers to moreeasily develop, visualize, debug, and optimize data flow programs and toconvert existing control flow programs into data flow programs forexecution on multiprocessor computer systems.

SUMMARY OF THE INVENTION

Methods, systems, and articles of manufacture consistent with thepresent invention facilitate development (e.g., visualization, debuggingand optimization) of new programs according to the data flow model.According to one aspect of the present invention, such methods, systems,and articles of manufacture, as embodied and broadly described herein,include a development tool that implements a block dependency approachthat allows an operator to define a memory region and divide the memoryregion into multiple blocks. Each block is associated with data (e.g., amatrix) needed by a function or other program operation, as well as codethat operates on that data. It is noted that a “block” refers to one ormore data elements in memory and does not imply a particular shape(e.g., square or rectangular) for the data elements or their placementin memory. In other words, a block refers to a portion of data inmemory, but does not necessarily indicate the structure or arrangementof the data in the memory. Additionally, the operator specifies anydependencies among the blocks, for example, a subsequent block may bespecified as dependent on an initial block. Such a dependency indicatesthat, before executing, the code associated with the subsequent blockneeds the code associated with the initial block to execute on the dataassociated with the initial block. As will be explained in detail below,the development tool facilitates development (including visualization,debugging, and optimization) of data flow programs using the blockdependency approach outlined above.

Methods, systems, and articles of manufacture consistent with thepresent invention overcome the shortcomings of the related art, forexample, by providing a data flow program development tool. Thedevelopment tool allows a programmer to visually identify datadependencies between code segments, observe the execution of a data flowprogram under development, insert breakpoints, and modify data blockcode and data assignments and dependencies. Thus, a programmer may moreeasily develop a new data flow program or convert a control flow programto the data flow paradigm.

In accordance with methods consistent with the present invention, amethod is provided for developing data flow programs. The methodincludes dividing a memory area into blocks and associating each blockwith data and with at least one code segment, generating a graphrepresentation of a data flow program, the representation comprisingnodes associated with the blocks, and dependencies between blocks thatgive rise to an execution order for the code segments, and pausingexecution of code segments in response to a debugging command includingat least one of inserting a breakpoint at a breakpoint node, and addingor deleting dependencies between nodes.

In accordance with systems consistent with the present invention, a dataprocessing system is provided for developing data flow programs. Thedata processing system includes a memory comprising a data flowdevelopment tool comprising instructions that associate data processedby a data flow program to blocks in memory, associate code segments ofthe data flow program to blocks, determine dependencies between blocksthat give rise to an execution order for the blocks, and monitor fordebugging commands including at least one of inserting a breakpoint at abreakpoint node, and adding or deleting dependencies between nodes. Thedata processing system further includes a processing unit that runs thedata flow development tool.

In accordance with articles of manufacture consistent with the presentinvention, a computer readable medium is provided. The computer readablemedium contains instructions that cause a data processing system toperform a method for developing data flow programs. The method includesdividing a memory area into blocks and associating each block with dataand with at least one code segment, generating a graph representation ofa data flow program, the representation comprising nodes associated withthe blocks, and dependencies between blocks that give rise to anexecution order for the code segments, and pausing execution of codesegments in response to a debugging command including at least one ofinserting a breakpoint at a breakpoint node, and adding or deletingdependencies between nodes.

In accordance with articles of manufacture consistent with the presentinvention, a computer readable medium is provided that is encoded with adata structure accessed by a data flow development tool run by aprocessor in a data processing system. The data structure includes nodesassigned to data processed by a data flow program and to code segmentsof the data flow program, dependencies between nodes, and debugginginformation including at least one of a breakpoint node, and a next stepnode.

Other apparatus, methods, features and advantages of the presentinvention will be or will become apparent to one with skill in the artupon examination of the following figures and detailed description. Itis intended that all such additional systems, methods, features andadvantages be included within this description, be within the scope ofthe present invention, and be protected by the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an example data flow graph for the calculation of anexpression.

FIG. 2 depicts a block diagram illustrating an example of a memoryregion.

FIGS. 3A and 3B depict block diagrams illustrating an example ofdependency relationships among the blocks of the memory regionillustrated in FIG. 2.

FIG. 4 depicts an example of a directed acyclic graph illustrating thedependency relationships shown in FIGS. 3A and 3B.

FIG. 5 depicts a block diagram of an exemplary data processing systemsuitable for use with methods and systems consistent with the presentinvention.

FIG. 6 depicts a flow chart of the steps performed by a data flowprogram development tool.

FIG. 7 depicts an example of a queue reflecting an order of execution ofmemory region blocks by a data flow program.

FIG. 8 depicts a block diagram of an exemplary multiprocessor computersystem suitable for use with methods and systems consistent with thepresent invention.

FIG. 9 depicts a flow chart of the steps performed during execution of adata flow program.

FIGS. 10A, 10B, and 10C depict block an execution cycle of a data flowprogram.

FIG. 11 is an exemplary memory region containing a block with an arrayof elements.

FIGS. 12A, 12B, 12C, and 12D illustrate the creation of dependenciesbetween blocks.

FIGS. 13-15 each shows three exemplary memory regions having blocksassigned to distribution groups.

FIG. 16 illustrates a movement technique for assigning blocks to nodes.

FIG. 17 depicts an example of a directed acyclic graph illustrating thedependency relationships shown in FIGS. 3A and 3B.

FIG. 18 depicts a flow chart of the steps performed by the data flowprogram development tool for graphically presenting execution of a dataflow program. FIGS. 19-25 depict the directed acyclic graph presented inFIG. 17 during the processing of the blocks in the directed acyclicgraph.

FIG. 26 depicts a flow diagram of the steps performed by the data flowprogram development tool when determining dependencies for a selectednode.

FIG. 27 depicts a flow diagram of the steps performed by the data flowprogram development tool when highlighting data affected by codesegments.

FIG. 28 depicts a flow diagram of the steps performed by the data flowprogram development tool when displaying the nodes executed by selectedthreads.

FIG. 29 depicts a flow diagram of the steps performed by the data flowprogram development tool when stepping to a selected node.

FIG. 30 depicts a flow diagram of the steps performed by the data flowprogram development tool when single stepping data flow programexecution.

FIG. 31 illustrates a flow diagram of the steps performed by the dataflow program development tool when saving and replaying data flowprogram execution.

FIG. 32 illustrates a flow diagram of the steps performed by the dataflow program development tool when adding or deleting dependencies froma DAG.

FIG. 33 illustrates a flow diagram of the steps performed by the dataflow program development tool when setting and testing for breakpoints.

FIG. 34 illustrates a DAG with a breakpoint.

FIG. 35 illustrates a DAG after execution stopped by a breakpoint.

DETAILED DESCRIPTION OF THE INVENTION

Reference will now be made in detail to an implementation consistentwith the present invention as illustrated in the accompanying drawings.Wherever possible, the same reference numbers will be used throughoutthe drawings and the following description to refer to the same or likeparts. Certain aspects of the present invention are summarized belowbefore turning to Figures.

Methods, systems, and articles of manufacture consistent with thepresent invention enable programmers to develop new data flow programsand to convert existing control flow programs to the data flow paradigm.To that end, the methods, systems, and articles of manufacture mayimplement a data flow program development tool.

Data flow programs developed in accordance with the principles of thepresent invention may be executed on a multiprocessor computer system ora distributed computer system using the data flow model. The developmenttool may execute on the same or different data processing system fromthat used for executing the data flow program under development.

Generally, the development tool facilitates dividing a memory regioninto blocks. Each block is associated with certain data and code, withdependencies specified between blocks. As will be explained in moredetail below, blocks that do not depend on one another can be executedin parallel, while blocks that do depend on one another await thecompletion of code execution and data manipulation of the block on whichthey depend.

Dependencies are reflected as conceptual links between dependent blocksand the precursor blocks from which they depend. A dependent block isdependent on a precursor block when the dependent block needs the resultof the precursor block in order for the dependent block to executesuccessfully. As will be shown below, dependency relationships may beviewed graphically using a directed acyclic graph (“DAG”). Nodes in thegraph correspond to blocks of the memory region, and thus the programcode and data assigned to the blocks.

During execution, the code associated with the blocks is queued forprocessing in a multiprocessor data processing system, for example, byplacing block pointers in a queue. Each processor may further executemultiple threads that can individually process blocks. In oneimplementation, the blocks are queued according to the dependencyinformation associated with each block. Additional information may alsoaffect the ordering of blocks in the queue, including priorityinformation, and the like.

The programmer may designate the number of threads available to processthe blocks. For example, the programmer may designate two threads perprocessor. Each thread may, for example, maintain a program counter andtemporary memory, as needed, to perform the code associated with theblocks.

Each thread, in turn, selects a block from the queue and executes theprogram code designated by the programmer for that block. As long asthere are blocks in the queue, the threads, when available, selectblocks and execute the associated program code. Threads select queuedblocks for execution in a manner that reflects block dependencyinformation. To that end, when an available thread selects a queuedblock for execution, the thread first examines the dependencyinformation for that block. When the block or blocks from which theselected block depends have completed execution, then the thread canproceed to execute the program code for the selected block. Otherwise,the thread may enter a wait state until it can begin executing theprogram code for the selected block.

Alternatively, the thread may select the next available block in thequeue, based on any priority if appropriate, and examine that block todetermine its status with respect to any blocks upon which it depends.Processing continues until the threads have completed executing theprogram code associated with all blocks in the queue. Note that whilethe multiprocessor data processing system may exist as a single physicalunit, that the threads may be distributed over multiple processorsacross multiple data processing systems, for example, across a LAN orWAN network.

The description below provides a detailed explanation of the methods,systems, and articles of manufacture consistent with the presentinvention.

At the beginning of the design and development process, a programmerspecifies a memory region and divides the memory region into blocksusing, for example, a graphical user interface component of thedevelopment tool. Below, the development tool will generally bedescribed in the context of developing a data flow program for matrixmanipulation. However, it is noted that the data element assigned toblocks may be scalars, structures, or any other type of data element.

FIG. 2 shows an example of a memory region 200 that contains sixteenblocks arranged in a four-by-four matrix, with each block identified bya row number and column number. For example, the block in the upper leftcorner of memory region 200 is labeled (1,1) indicating that it islocated in the first row and the first column, and the block in thelower right hand corner of region 200 is labeled (4,4) indicating thatit is located in the lower right corner. Each block contains a data set,such as a matrix or array of values or information, to be processed inaccordance with certain program code. As an example, the memory region200 may represent a 100×100 matrix of scalars, with each blockrepresenting a 25×25 subarray of the larger matrix. Although the memoryregion 200 and the blocks are shown are regular squares, the scalarsneed not be located contiguously in memory. Rather, the development toolpresents the memory region 200 and the blocks to the programmer as shownin FIG. 2 as a user friendly view of the data that the data flow programwill work with.

After defining the memory region and dividing it into blocks, theprogrammer specifies a state for each block. The state of a blockgenerally corresponds to the program code that the programmer assigns tothat block. In other words, the assigned code is a portion of a programthat the programmer intends to operate on the data in the block. Theinterface provides the programmer with a window or other input facilityto provide the program code for a block and internally tracks theassignment of code to the blocks.

In the example region 200, the group of blocks 202 labeled (1,1), (2,1),(3,1), and (4,1) share a first state, the group of blocks 204 labeled(1,2), (1,3), and (1,4) share a second state, and the group of blocks206 labeled (2,2), (2,3), (2,4), (3,2), (3,3), (3,4), (4,2), (4,3), and(4,4) share a third state. Although the region 200 and the blocks202-206 are shown as being uniform in size, in practice a memory regionand blocks may have different shapes and sizes, hold different types ofdata, and be distributed in memory contiguously or non-contiguously.

Next, the programmer specifies dependency relationships between theblocks. A dependency relationship exists when the code associated with afirst block is dependent upon the result or final state of the dataassigned to a second block. Thus, the code assigned to the first blockneeds to wait for execution of the code assigned to the second block.FIGS. 3A and 3B illustrate three examples of dependency relationshipsbetween blocks in the memory region 200 of FIG. 2. As shown in FIG. 3A,each of the blocks labeled (1,2), (1,3), and (1,4) are dependent on theblocks labeled (1,1), (2,1), (3,1), and (4,1). Thus, the blocks labeled(1,1), (2,1), (3,1), and (4,1) provide results needed by the blocks(1,2), (1,3), and (1,4).

Similarly, FIG. 3B illustrates dependencies among each of the blockslabeled (1,2), (1,3), and (1,4) and the blocks labeled (2,2), (2,3),(2,4), (3,2), (3,3), (3,4), (4,2), (4,3), and (4,4). As shown, the blocklabeled (1,2) is assigned data needed by the blocks in the same columnlabeled (2,2), (3,2), and (4,2); the block labeled (1,3) is assigneddata needed the blocks in the same column labeled (2,3), (3,3), and(4,3); and the block labeled (1,4) is assigned data needed by the blocksin the same column labeled (2,4), (3,4), and (4,4). FIGS. 3A and 3Billustrate examples of dependencies for the memory region 200; aprogrammer may, of course, specify many other dependencies as necessaryto reflect the data processing structure of a data flow program underdevelopment.

Note also that the development tool may also provide a dependencyanalysis component. The dependency analysis component examines programcode to identify code that reads or writes specific data. Thus, thedependency analysis component may automatically insert dependenciesbetween blocks when the programmer specifies the code to be assigned toeach block. To that end, the development tool may build a separate steptree.

The step tree is a data structure that represents program execution as aseries of steps. The programmer adds steps to the tree, and specifies tothe development tool which data objects that particular step reads orwrites. For example, the programmer may use data read and data writeidentifiers (e.g., pointers or handles) to specify the data. Theprogrammer further specifies a code section executed at that step. Assteps are added, the step tree grows and maintains the order of thesteps, and thus the order and dependencies for data objects needed bythe code sections associated with the steps. The development tool maythen parse the step tree to automatically extract block dependencies.

The development tool constructs a DAG using the dependency information.FIG. 4 presents an example of a DAG 400 illustrating the dependencyrelationships shown in FIGS. 3 a and 3 b. The DAG 400 illustratesgraphically that the processed data associated with all of the blockssharing the first state is needed by the code associated with the blockssharing the second state. In turn, the processed data associated withthe blocks sharing the second state is needed by particular blocks thatshare the third state. The development tool may use the DAG 400 to orderthe blocks for processing as explained below.

FIG. 5 depicts an exemplary data processing system 500 suitable forpracticing methods and implementing systems consistent with the presentinvention. The data processing system 500 includes a computer system 510connected to a network 570, such as a Local Area Network, Wide AreaNetwork, or the Internet.

The computer system 510 includes a main memory 520, a secondary storagedevice 530, a central processing unit (CPU) 540, an input device 550,and a video display 560. The main memory 520 contains a data flowprogram development tool 522 and a data flow program 524. The memoryalso holds a data flow DAG 526 and a step tree 528. The data flowprogram development tool 522 provides the interface for designing anddeveloping data flow programs, including programs that utilize controlflow program code. Using display 560, the development tool 522 enablesprogrammers to design memory regions, such as region 200 of FIG. 2, anddivide the regions into blocks with corresponding states. The toolfurther enables programmers to write program code to operate on each ofthe blocks using a multiprocessor computer system (see FIG. 7).

The data flow program 524 represents a program designed in accordancewith the data flow paradigm developed by the data flow tool 522. Thedata flow program 524 includes, for example, information specifying amemory region, the blocks of the region, the program code associatedwith each block, and dependency relationships between the blocks.

Although aspects of one implementation are depicted as being stored inmemory 520, one skilled in the art will appreciate that all or part ofsystems and methods consistent with the present invention may be storedon or read from other computer-readable media, such as secondary storagedevices, like hard disks, floppy disks, and CD-ROM; a carrier wavereceived from a network such as the Internet; or other forms of ROM orRAM. Finally, although specific components of data processing system 500have been described, one skilled in the art will appreciate that a dataprocessing system suitable for use with methods and systems consistentwith the present invention may contain additional or differentcomponents.

FIG. 6 is a flow chart of the process 600 performed by the developmenttool 522 interacting with programmers to construct data flow programs.After a programmer initiates execution of the development tool 522, thedevelopment tool 522 displays one or more windows that the programmeruses to construct a data flow program. First, the development tool 522displays a window in which the programmer defines a memory region (step610). The programmer uses the development tool 522 to divide the regioninto blocks (step 620).

As long as there are blocks in a region to be processed (step 630), theprogrammer selects a block (step 640), identifies any other block(s)that influence the selected block's final state (in other words,block(s) upon which the selected block is dependent) (step 650), andspecifies the program code for each block, for example, a portion of anexisting control flow program (step 660). In this manner, an existingcontrol flow program may be converted to a data flow paradigm. Note,however, that the programmer may instead write new code for each blockas part of the process of constructing a new data flow program.

After all of the blocks have been processed (steps 640 to 660), theprogrammer establishes the dependency relationships among the blocks bygraphically linking them together (step 670). Alternatively oradditionally, as explained above, the programmer may add steps to thestep tree, and instruct the development tool 522 to automaticallyextract dependencies. In other words, with the steps described above,the development tool 522 first assists the programmer in defining aproblem to be solved. Subsequently, the development tool 522 producessource files that can be compiled and run (step 675). The source filesinclude code that (at run-time) produces in memory a DAG with the nodesand dependencies defined according to the steps set forth above. Duringrun-time, the nodes are placed on a queue (step 680). The nodes thusform the basis for parallel execution.

The development tool 522 uses the dependency/link information to queuethe blocks in a manner that reflects an acceptable order for processing.For example, a first block dependent upon a second block may be placedin the queue after the second block. For the example shown in FIGS. 2-4,the blocks may be queued in the manner shown in FIG. 7 with the blockssharing the first state 202, (1,1), (2,1), (3,1), and (4,1), queuedbefore the blocks with the second state 204, (1,2), (1,3), and (1,4),and followed by the blocks sharing the third state 206, (2,2), (2,3),(2,4), (3,2), (3,3), (3,4), (4,2), (4,3), and (4,4).

As noted above, the data flow program under development may be executedin a multiprocessor data processing system. The multiprocessor dataprocessing system may take many forms, ranging from a singlemultiprocessor desktop computer to network distributed computer systemswith many nodes. FIG. 8 illustrates one implementation of amultiprocessor data processing system 810.

The data processing system 810 includes a network interface 820 thatallows a programmer to transfer the data flow program from thedevelopment tool environment (e.g., FIG. 5) for execution inmultiprocessor computer system 810. Alternatively, the development tool522 may execute on the same data processing system 810 on which the dataflow program will execute.

The data processing system 810 includes, shared memory 830 and multipleprocessors 840 a, 840 b, . . . 840 n. The number and type of processorsmay vary depending on the implementation. As one example, a SunMicrosystems HPC Server with a multiple processor configuration may beused as the data processing system. Processes execute independently oneach of the processors in the data processing system 810. A process inthis context may include threads controlling execution of program codeassociated with a block of a data flow program developed using tool 522.

Turning next to FIG. 9, the operation of a data flow program inaccordance with the present invention will now be described withreference to the process 900. Multiple threads are used to process thecode associated with the blocks of the data flow program. The number ofthreads may vary depending on the implementation. As examples, theprogrammer may specify one thread per processor, or the data processingsystem 810 may determine the number of threads based on the number ofavailable processors and an analysis of the data flow program.

If a thread is available to process the code associated with a block(step 910), the thread determines whether there are any blocks in thequeue (step 920). If so, the available thread selects a block from thequeue for processing (step 930). Typically, the blocks are selected fromthe queue based on the order in which they were placed in the queue. If,however, a thread determines that a selected block is dependent upon ablock associated with code that has not yet been executed (step 940),the thread skips the selected block (step 950). Otherwise, when theblock dependencies for the selected block have been satisfied (step940), the thread uses an assigned processor to execute the program codeassociated with the selected block (step 960). Processing generallycontinues until the threads have executed the code associated with eachblock in the queue (step 920).

In a manner consistent with operation of the process 900, the FIGS. 10a-c illustrate a portion of the queue of FIG. 7, including the firstfive blocks of the memory region 200 queued for processing. As shown inFIG. 10 a, each thread processes a selected block using one of theprocessors. In this example, there are four threads and four processors.When a thread completes processing (shown for example in FIG. 10 b wherea thread completes program execution of the block labeled (1,1)), thethread attempts to execute the next available block in the queue, inthis case, the block labeled (1,2). However, the thread does not proceedto execute because the block labeled (1,2) is dependent upon the finalstate of other blocks still being executed, namely, blocks (2,1), (3,1),and (4,1).

Once execution of the program code for the above-noted blocks hascompleted, as shown in FIG. 10 c, a thread can continue processing withblock (1,2). Instead of remaining idle, a thread may skip ahead toprocess other queued blocks when the dependency relationships for thosequeued blocks are met. Also, although FIG. 10 shows four threads andfour processors, more or fewer threads or processors may be useddepending upon the particular implementation.

The following description sets forth additional specifications the usermay supply while developing a data flow program. In one implementation,the user may further specify the memory regions by inputting into thedevelopment tool 522 the following control flow variables andparameters:

Name: A unique name

Kind: Determines whether the memory region is an input to the problem,an output, input and output, or temporary space used only duringevaluation of the problem.

Type: Corresponds to the data type of the elements of the memory region,for example, integer, real, and the like.

Dimensions: 0 for a scalar, 1 for a vector, 2 for a matrix. Higherdimensions may also be used.

Size: A size for each dimension of the memory region.

Grid: A size for each dimension of the blocks in a memory region.

Leading dimension: The size of the first dimension of matrices (when amemory region is larger than the matrix it holds).

In some applications under development, it may be useful for the programcode that performs steps on the blocks to be able to access andmanipulate the elements of a block. For example, when program codeperforms matrix manipulation operations, the program code may benefitfrom information concerning the matrices or sub-matrices stored in oneor more blocks. Macros allow the programmer to write program code thatwill perform operations on the blocks at each node in the DAG. Themacros access specific elements and attributes of a block in a memoryregion. Taking a block in a memory region as an argument, the macro mayreturn for instance, the number of rows or columns in the block, or thenumber of rows or columns in the memory region. The following tablelists several exemplary macros that the programmer may apply in programcode and that will act on a block in a memory region: Macro Description#AROW(OBJ) evaluates to the absolute row of the first element in theblock, the true index #ACOL(OBJ) evaluates to the absolute column of thefirst element in the block #NROWS(OBJ) the number of rows in the block#NCOLS(OBJ) the number of columns in the block #ANROWS(OBJ) the numberof rows of elements in the memory region #ANCOLS(OBJ) the number ofcolumns of elements in the memory region #GROWS(OBJ) the number of rowsof elements per block #GCOLS(OBJ) the number of columns of elements perblock #RECROW Converts INDEX, and absolute index based on the(OBJ,INDEX) current level of recursion and converts it to a trueabsolute index #RECCOL Converts INDEX, and absolute index based on the(OBJ,INDEX) current level of recursion and converts it to a trueabsolute index

FIG. 11 shows an exemplary memory region 1100 with blocks havingelements arranged in a 10×10 fashion. Given this memory region 1100 witha block 1102 located as shown on the figure, the following macrosevaluate for this block 1102 as shown in the following table: MacroValue #ROW(A) 3 #COL(A) 2 #AROW(A) 21 #ACOL(A) 11 #NROWS(A) 10 #NCOLS(A)10 #ANROWS(A) 40 #ANCOLS(A) 40 #GROWS(A) 10 #GCOLS(A) 10

It should be noted that recursive program codes may be used in which theprocess repeatedly applies over a smaller region. In this case, therecursion stops when a base case is reached and the region becomes sosmall that there is not enough left to repeat the process. Specificprogram code can be associated with a recursive process that will onlybe executed for the base case. For example, assume that a recursiveprocess is defined that moves over one block column and down one blockrow at each level of recursion. The following recursive macros evaluateat each level as shown in the following table: Recursive Level MacroLevel 1 Level 2 Level 3 #RECROW(A,1) 1 11 21 #RECCOL(A,6) 6 16 26

Additionally, the programmer may designate program code as sub-DAGprogram code. The sub-DAG designation instructs the development tool 522to build a sub-DAG for the code associated with a particular node. Inother words, any node in a DAG have, underlying, another DAGspecifically directed to the code associated with that node. Thus, theprogrammer may develop parallelism across a whole application, or insidesmaller pieces of code. The programmer may view the resulting hierarchyof DAGs by inputting to the development tool 522 one or more DAGs thatthe development tool 522 should display.

As stated previously, dependencies are specified manually orautomatically between blocks and denote which blocks need to be executedbefore other blocks. The dependencies, in turn, determine theconnections between nodes in a DAG representing execution order. Often,several blocks in a memory region depend on several other blocks in thesame memory region. Although in most instances automatic specificationof dependencies (using the step tree explained above) is suitable, thedevelopment tool 522 further provides an input option that a programmermay use to quickly denote dependencies between multiple blocks.

FIG. 12A, for example, shows a programmer denoting a parent block 1202for a set of blocks 1204 (or state) using a development tool 522 userinterface (e.g., responsive to mouse and keyboard input). In thisimplementation, the parent block 1202 represents the starting upper leftcorner of a set of parent blocks to be designated. Then the programmerspecifies whether the dependency on the parent block 1202 is fixed orfree with respect to row and column.

FIGS. 12B-D illustrate different combinations of fixed and freedesignations given an exemplary dependent set of blocks 1204. If theprogrammer designates the dependency as fixed, all blocks in thedependent set of blocks 1204 depend on the processing of the parentblock 1202 (FIG. 12A). If the dependency is free with respect to row,the block that is depended on varies as row location in the dependentset of blocks 1204 varies (from the upper left block) (FIG. 12B).Similarly, if the dependency is free with respect to column, the blockthat is depended on varies as column location in the dependent set ofblocks 1204 varies (from the upper left block) (FIG. 12C). If thedependency is free with respect to row and column, the block that isdepended on varies as location in the dependent set of blocks varies(FIG. 12D). Through this method of designating dependencies, thedevelopment tool 522 allows a programmer to quickly manually designatemultiple block dependencies.

For the purposes of assigning blocks to nodes in a DAG, the developmenttool 522 may provide either or both of a “distribution” mechanism and a“movement” mechanism. With regard first to “distributions”, thedevelopment tool 522 permits the programmer to assign certain types of“distributions” to sets of blocks in a memory region. The distributionsthen control the manner in which blocks are assigned to nodes in a DAG.The distributions may be used to flexibly group different blocks into asingle node and consequently allow different parallel processingapproaches to be used for execution of a problem.

For example, given that the result of a 3×3 matrix multiply problem is a3×3 matrix, the programmer may first select 9 threads to operate on 9nodes, one for each value in the resulting matrix. However, theprogrammer, as an alternate approach, may select 3 threads to process 3nodes, one for each column in the resulting matrix. In the alternateapproach, a node will contain more blocks but the data flow program willuse less threads. The varying distributions give the programmerflexibility in testing different parallel processing techniques.

To designate a distribution, the programmer selects a rectangular areaof the memory region to identify a set of blocks. In addition todetermining the allocation of blocks to nodes, the distributionsoptionally control which blocks macros operate on. To this end, thedevelopment tool 522 may support two main categories of distributions:primary and secondary. The difference between primary and secondarydistributions is that the development tool 522 may, if selected by theprogrammer, restrict macros to operate on blocks in primarydistributions but not on blocks in secondary distributions. The primarydistribution generally determines how many nodes there will be in theDAG for data flow program under development. For a set of blocks thatthe programmer designates as a secondary distributions, the developmenttool adds each block in the set of blocks to the same node of the DAG.

Distributions may be categorized as “primary single”, “secondarymultiple row,” “secondary multiple column,” “secondary all,” and“multiple” (either primary or secondary). Primary single distributionscontrol how many DAG nodes are created. If a primary single distributionis present in a memory region, the development tool 522 will create oneDAG node for each block in the distribution. Each block in a primarysingle distribution will enter its own node; no two blocks of a givenprimary single distribution will share the same node. The developmenttool 522 will also assign each block in additional primary singledistributions (e.g., in additional memory regions) to the nodes in theDAG as well.

For all other types of distributions, the development tool 522determines which block in the additional distribution is added to a DAGnode through a process that can be conceptualized as visually placingthe additional distribution over the primary single distribution. Theblock in the additional distribution that is in place over a primarysingle distribution block is added to the node containing that primarysingle distribution block.

Secondary distributions include secondary multiple row, secondarymultiple column, and secondary all distributions. When a block in asecondary multiple row distribution is added to a node, then all of theblocks in the row of that block are also added to the node. Similarly,for secondary multiple column distributions, the each block in thecolumn is added. In secondary all distributions, when a block in thedistribution is added to a node, every block in the distribution isadded to the node.

Multiple distributions may be primary or secondary. If the primarysingle distribution is larger than the multiple distribution, thenblocks from the multiple distribution are added to nodes in a processthat may be conceptualized as iteratively placing the multipledistribution over the primary distribution and shifting until themultiple distribution has covered the whole primary distribution. Ateach iteration, a multiple distribution block that is over a primarydistribution block is entered into the same node containing the primarydistribution block.

Distributions may also have a transpose attribute. The transposeattribute indicates that the distribution is transposed before theoverlaying process is applied.

FIG. 13 shows exemplary memory regions used in a matrix multiplicationproblem involving three 2-dimensional memory regions, A, B, and C.Assume that each memory region has row and column sizes such that thememory regions are divided into square blocks as shown in FIG. 13. Theoperation A*B=C can be performed in parallel using several differentapproaches. First, consider an approach in which each block of C iswritten by a different thread. A block in C is formed by multiplying theblocks in the corresponding row of A by the corresponding column ofblocks in B. In this example, the dashed lines represent thedistributions created by the user.

For the 3×3 case depicted in FIG. 13, since C has a primary singledistribution, the development tool 522 establishes a node in a DAG foreach of the nine blocks. In response to the secondary multiple rowdistribution on A and the multiple column distribution on B, thedevelopment tool 522 adds the rows of A and columns of B to nodes asexplained above. For example, when the C(1,1) block is added to thenode, the A(1,1) and B(1,1) blocks are also added. Because the A(1,1)block is in a secondary multiple row distribution, all of the blocks inthat row are also added to the same node. Similarly, because the B(1,1)block is in a secondary multiple column distribution, all of the blocksin that column are added to the same node.

The resulting nodes that the development tool 522 creates are shown inthe table below. In the table, the ordered pair specifies the row andcolumn of each block added, and the hyphen (“-”) specifies a range ofrows or columns when more than one block is added from a distribution.Node Blocks Added Node 1 C(1,1), A(1,1-3), B(1-3,1) Node 2 C(1,2),A(1,1-3), B(1-3,2) Node 3 C(1,3), A(1,1-3), B(1-3,3) Node 4 C(2,1),A(2,1-3), B(1-3,1) Node 5 C(2,2), A(2,1-3), B(1-3,2) Node 6 C(2,3),A(2,1-3), B(1-3,3) Node 7 C(3,1), A(3,1-3), B(1-3,1) Node 8 C(3,2),A(3,1-3), B(1-3,2) Node 9 C(3,3), A(3,1-3), B(1-3,3)

FIG. 14 shows primary A and B distributions created for the same matrixmultiply problem. The distributions shown in FIG. 14 result in thefollowing 9 nodes: Node Blocks Added Node 1 C(1,1), A(1,1), B(1,1),A(1,2-3), B(2-3,1) Node 2 C(1,2), A(1,1), B(1,2), A(1,2-3), B(2-3,2)Node 3 C(1,3), A(1,1), B(1,3), A(1,2-3), B(2-3,3) Node 4 C(2,1), A(2,1),B(1,1), A(2,2-3), B(2-3,1) Node 5 C(2,2), A(2,1), B(1,2), A(2,2-3),B(2-3,2) Node 6 C(2,3), A(2,1), B(1,3), A(2,2-3), B(2-3,3) Node 7C(3,1), A(3,1), B(1,1), A(3,2-3), B(2-3,1) Node 8 C(3,2), A(3,1),B(1,2), A(3,2-3), B(2-3,2) Node 9 C(3,3), A(3,1), B(1,3), A(3,2-3),B(2-3,3)

As an example, the program code that executes on each node may berepresented by a FORTRAN function, MATRIX_MULTIPLY, that takes asarguments the location, number of rows, and number of columns of thethree matrices A, B, and C, respectively. CALL MATRIX_MULTIPLY (A(#AROW(A),1),#NROWS(A),#ANCOLS(A),$   B(1,#ACOL(B)),#ANROWS(B),#NCOLS(B),$   C(#AROW(C),#ACOL(C)),#NROWS(C),#NCOLS(C))

FIG. 15A shows another allocation of distributions for the matrixmultiplication problem in which the programmer has determined that eachthread will process a column of blocks in C. In this case, thedevelopment tool 522 creates three nodes because there are three blocksin the primary single distribution. As explained above, when themultiple column distributions are laid over the primary singledistribution, each block over a primary single distribution block isadded to the same node as that primary distribution block, along withthe additional block in the same column of the multiple columndistribution. In the example shown in FIG. 15, for example, the blockB(2,1) of the secondary multiple column distribution of B isconceptually positioned over C(1,1). Thus, the development tool 522 addsthe block B(2,1) to the node containing C(1,1). Furthermore, becauseblock B(2,1) is part of a multiple column distribution, the block B(2,2)in the same column as B(2,1) is also added to the node containingC(1,1). Also note that when the development tool 522 adds a block from Ato a node, all blocks from A are added to that node because all theblocks of A are designated as a secondary all distribution. Node BlocksAdded Node 1 C(1,1), B(1,1), A(1-3,1-3), C(2-3,1), B(2-3,1) Node 2C(1,2), B(1,2), A(1-3,1-3), C(2-3,2), B(2-3,2) Node 3 C(1,3), B(1,3),A(1-3,1-3), C(2-3,3), B(2-3,3)

The following program code may be used to execute the multiplication:CALL MATRIX_MULTIPLY (A(1,1),#ANROWS(A),#ANCOLS(A),$   B(1,#ACOL(B)),#ANROWS(B),#NCOLS(B),$   C(1,#ACOL(C),#ANROWS(C),#NCOLS(C))

FIG. 15B shows another example where the transpose of B is to bemultiplied by A to form C. The transpose attribute explained aboveallows several of the allocations from the previous example to bereused, with modifications to the memory area B as shown in FIG. 15B.

As noted above, the development tool 522 also supports a “movement”mechanism for adding blocks in a memory area to nodes in a DAG. Turningnext to FIG. 16, that figure shows three examples of the movementmechanism on a memory area M: a row movement 1602, a column movement1604, and a combination movement 1606.

With regard to the row movement 1608, the programmer first draws (orspecifies using another input mechanism such as a keyboard) theselection 1608 shown in FIG. 16. The development tool 522 then moves theselection 1608 across the memory area M until the leading edge of theselection 1608 hits a boundary of the memory area. At each position, thedevelopment tool 522 adds the blocks covered by the selection 1608 to anode in the DAG. Thus, for the row movement 1608, the development tool522 adds three nodes to the DAG.

Similarly, with regard to the column movement 1604, the programmer firstdraws the selection 1610 shown in FIG. 16. The development tool 522 thenmoves the selection 1610 across the memory area M until the leading edgeof the selection 1608 hits a boundary of the memory area. At eachposition, the development tool 522 adds the blocks covered by theselection 1610 to a node in the DAG. Thus, for the row movement 1608,the development tool 522 adds three nodes to the DAG.

The combination movement 1606 operates in the same fashion. Inparticular, the development tool 522 moves the selection 1612 over thememory area M until the leading edge of the selection 1612 hits aboundary in each direction of movement. Thus, the for the combinationmovement 1606, the development tool 522 creates four DAG nodes, eachassociated with four blocks.

Methods and systems consistent with the present invention also providevisualization support for developing data flow programs. As will beexplained in more detail below, the development tool 522 supports thevisual representation and presentation of: code segments as one or morenodes in a DAG, attributes that signify that a code segment has alreadyexecuted, is currently executing, or has not yet begun executing,dependencies of a code segment on other code segments with an attributethat signifies whether the dependency has been met, the portions of oneor more data structures that are effected by a code segment, and nodesthat a selected thread has executed.

For example, FIG. 17 depicts a DAG 1700 illustrating the dependencyrelationships corresponding to FIGS. 3A and 3B. The DAG 1700 illustratesgraphically that the data associated with the blocks sharing the firststate 1702 are needed for processing by each of the blocks sharing thesecond state 1704. In turn, the data associated with the blocks sharingthe second state 1704 are needed by the groups of blocks that share thethird state 1706.

In this embodiment, the development tool 522 represents an unexecutedcode segment as a diamond-shaped node, an executing code segment as asquare node, and an executed code segment as a circular node. Thedevelopment tool 522 also represents an unmet dependency as a dashed arcand a satisfied dependency as a bolded, solid arc. One skilled in theart, however, will recognize that any change in representation of thenodes and arcs (e.g., a change in shape, color, shading, animation,sound, and the like), may be used to represent the nodes and arcs indifferent states. Thus, the nodes and arcs used in the methods, systems,and articles of manufacture consistent with the present invention arenot limited to those illustrated. Rather, the development tool 522generally presents an unexecuted node using an unexecuted visualization,an executing node using an executing visualization, and an executed nodeusing an executed visualization, while representing arcs with anunsatisfied dependency visualization or a satisfied dependencyvisualization.

FIG. 18 depicts a flow chart of the steps performed by the data flowprogram development tool 522 for visualization of the state of the codesegments on the DAG. Initially, the development tool 522 receives anindication to run the program (step 1802). The next step performed bythe development tool 522 is to wait until a processor is available (step1804). When a processor becomes available, the development tool 522selects a block and its associated code from the queue (step 1806). Thedevelopment tool 522 then checks to determine whether all of thedependencies for the selected block are met (step 1808). If all of thedependencies for the selected block of code are met, the developmenttool 522 executes the selected block on the processor (step 1810). Ifall of the dependencies for the selected block are not met, then thedevelopment tool 522 continues to search for a block of code that doeshave all of its dependencies met. As a result, the program adapts todifferent environments (e.g., machine load, number of threads, and thelike) by executing the code segments that are ready. Thus, rather thancontinuing to wait on an originally selected code segment until it isready to execute, the development tool 522 can execute code segmentsthat become ready sooner than the originally selected code segment. Whenthe selected block is executed, the development tool 522 modifies thenode for the selected block to indicate that the code is executing (step1812). Assuming there are three threads running in parallel, three codesegments can be executed simultaneously.

Thus, as shown in FIG. 19, three of the nodes 1902, 1904 and 1906 on theDAG 1900 are square nodes to indicate that the code segments representedby the nodes are executing.

The next step performed by the development tool 522 is to wait until theexecution of the block is complete (step 1814). After the execution ofthe code segment is complete, the development tool 522 modifies the nodeof the selected block to indicate that the execution is complete (step1816). The development tool 522 also modifies the appearance of anydependency arcs out of the selected block to indicate that thedependency has been met (step 1818). Thus, after the execution of node1902 in DAG 1900 is complete, the development tool 522 displays the node1902 as a circular node 2002 (see the DAG 2000 in FIG. 20). In addition,the development tool 522 displays the arcs 2010, 2012, and 2014 out ofnode 2002 as bolded, solid arcs 2010, 2012, and 2014 to indicate thatthe dependencies out of the node 2002 have been met.

Next, the development tool 522 determines whether there are any moreblocks on the queue awaiting execution (step 1820). If there are no moreblocks, the processing ends. If there are more blocks available, thedevelopment tool 522 continues processing at step 1804. Returning to theexample depicted in FIG. 20, because the code segment represented bynode 2002 is no longer executing, a thread or processor becomesavailable. Thus, the development tool 522 selects the next block(represented by node 2008) from the queue. Since all dependencies forthe selected block are met, the development tool 522 executes theselected block, and represents the node 2008 as a square node toindicate that the code is executing. Meanwhile, the code segmentsrepresented by nodes 2004 and 2006 continue to execute.

After the execution of the next code segment associated with a blockassigned to node 2004, the development tool 522 represents the node 2004as a circular node 2104 (see FIG. 21). The development tool 522 alsomodifies the arcs 2110, 2112, and 2114 to indicate that the dependenciesfrom the code segment associated with a block assigned to node 2104 havebeen met. As shown in FIG. 21, the code segments represented by nodes2102 and 2104 have been executed, while the code segments represented bynodes 2106 and 2108 are still executing. Because a processor has becomeavailable, the tool 522 selects the next block from the queue. Thisblock is represented by node 2116.

As depicted in the DAG 2100 shown in FIG. 21, two of the dependenciesfor the block associated with node 2116, represented by arcs out ofnodes 2106 and 2108, have not yet been met. Thus, the development tool522 does not begin execution of the code segment associated with theblock for node 2116 (and its shape remains a diamond). Rather, thedevelopment tool 522 continues to check the queue for code segments thatare ready to execute. However, the only code segments ready to executeare in fact currently executing (2106 and 2108). Thus, only one threadis idle while one thread executes node 2106 and one thread executes node2108. When the threads finish, the execution of the code segmentsrepresented by nodes 2202, 2204, 2206, and 2208 are complete (see DAG2200 depicted in FIG. 22). Also, at this point, three threads orprocessors are available and the development tool 522 continues to checkthe queue for code segments ready to execute. Thus, the development tool522 selects and executes the next code segments for blocks in the queuerepresented by nodes 2210, 2212 and 2214.

After execution of the code segment associated with the blockrepresented by node 2210, the development tool 522 displays the node asa circular node 2310 (see the DAG 2300 shown in FIG. 23). At this point,the code segments associated with blocks represented by nodes 2302,2304, 2306, 2308, and 2310 have been executed. In addition, thedevelopment tool 522 represents the dependencies out of node 2310 assolid, bolded arcs 2318, 2320, and 2322 to indicate that thesedependencies are met. The development tool 522 then selects the nextcode segment from the queue associated with a block represented by node2316. The development tool 522 determines that all dependencies for theselected node are met, begins execution of the code associated with theselected node, and represents the selected node as a square node 2316 toindicate that the code segment is executing. Similarly, when theexecution of the code segments associated with blocks represented bynodes 2312 and 2314 is also complete, the nodes 2402, 2404, 2406, 2408,2410, 2412, and 2414, depicted in FIG. 24, indicate that the executionof these code segments is complete. At this point, all dependencies inthe DAG 2400 are met. DAG 2500 in FIG. 25 illustrates the state of allnodes and dependencies after all code segments have been executed andall dependencies have been met.

Methods and systems consistent with the present invention allow aprogrammer to view the dependencies of a code segment on other codesegments. The development tool 522 may use different representations fora dependency that has been met and a dependency that has not been yet(as explained above). The dependency view allows a programmer to quicklyascertain the impact of changes to the DAG on other nodes in the DAG.

FIG. 26 depicts a flow chart of the steps performed by the data flowprogram development tool 522 to display the dependencies of a selectedcode segment. The neighboring DAG portion 2602 illustrates graphicallythe operation of the development tool 522. Initially, the developmenttool 522 determines a selected block of code through keyboard or mouseinput, as examples (step 2604). The selected block of code is generallyassociated with a block and a node in the DAG. Thus, the developmenttool 522 may optionally modify the appearance of the associated node inthe DAG (step 2606). As examples, the associated node may change inappearance from a diamond to a square, become bolded, change its linestyle, and the like.

The development tool 522 continues to trace arcs back through the DAG(step 2608). As development tool 522 finds new dependencies thedependencies are highlighted for the programmer. When there are no arcsleft to explore, the processing ends.

The development tool 522 may also present to the programmer portions ofdata that are affected by a code segment. For example, the developmenttool 522 may show a view of the elements of a data structure, theelements of an array, and the like. As the data flow program executes,the development tool 522 highlights the data that one or more codesegments currently executing are modifying.

Turning next to FIG. 27, that figure presents a flow diagram 2700 of thesteps performed by the development tool 522 when presenting to theprogrammer portions of data that a code segment effects. The developmenttool 522 determines the selected data for monitoring (step 2702). Thus,as shown in the node view 2703, the programmer has selected, using thedashed selector box, a data element associated with the node. Inparticular, the programmer has selected the matrix M.

Subsequently, the development tool 522 provides a graphicalrepresentation of the matrix M (step 2704). As shown in the node view2705, the matrix is shown with boxes representing its constituentelements M1, M2, M3, and M4. The development tool 522 monitors for readsand/or writes to the selected data as threads execute code segmentsassociated with DAG nodes (step 2706). When the development tool 522detects that the selected data has been affected by a code segment, thedevelopment tool 522 highlights or otherwise modifies the graphicalrepresentation so that the programmer can observe which parts of theselected data are changing. For example, in the node view 2709, thedevelopment tool 522 has cross-hatched elements M1 and M4 to show thatan executing code segment is reading or writing to those elements.

An additional visualization option available to the programmer is thethread path view. When the programmer selects the thread path view, thedevelopment tool 522 provides the programmer with a display that shows,for each thread selected by the programmer, the set of nodes executed bythose threads. As a result, the programmer can ascertain which threadsare under or over utilized, for example, and experiment withmodifications to the data flow program that allow the data flow programto perform better.

Turning to FIG. 28, that figure presents a flow diagram 2800 of thesteps performed by the development tool 522 when presenting to theprogrammer a thread path view. The development tool 522 determines thethreads selected by the programmer (in this instance using a radiobutton selection) (step 2802). Thus, as shown in the selection box 2803,the programmer has selected, thread 2 and thread 3.

Subsequently, the development tool 522 displays the nodes executed bythe selected threads. For example, the thread path view 2805 shows thatthread 2 executed nodes (1,1), (1,2), (2,2), and (2,3), and that thread3 executed nodes (3,3) and (3,4). Alternatively, the development tool522 may present the thread path view by highlighting nodes on a DAG incorrespondence with colors, line styles, and the like assigned tothreads.

The thread path view indicates which threads executed which nodes. Tothat end, the development tool 522 may maintain execution informationduring data flow program execution that is useful for presenting thethread path view. The execution information may include, as examples, atime stamp, thread identification, node identification, and the like.

As noted above, the development tool 522 also provides debuggingfunctions. The debugging functions respond to debugging commands thatinclude, as examples, the ability to step to a point in data space, theability to single step in data space (step debugging commands), theability to add breakpoints (breakpoint debugging commands), the abilityto save program execution information for later replay (replay debuggingcommands), and the ability to add or delete block dependencies(dependency modification debugging commands).

FIG. 29 presents a flow diagram 2900 of the steps performed by thedevelopment tool when allowing the programmer to step to a point in dataspace. The development tool 522 obtains from the programmer anindication (e.g., a mouse click on a DAG node, keyboard input, or thelike) of the next node that the programmer wants the development tool522 to process (step 2902). The development tool 522 then optionallyhighlights the selected node and determines the dependencies for theselected node (steps 2904 and 2906).

In other words, before the development tool 522 executes the code forthe selected node, the development tool 522 first satisfies thedependencies for the selected node (step 2908). Once the dependenciesfor the selected node are satisfied, the development tool 522 executesthe code for the selected node (step 2910). Processing then stops andthe programmer may review the results obtained by execution of theselected node.

Turning next to FIG. 30, that figure illustrates a flow diagram 3000 ofthe steps performed by the development tool 522 when allowing theprogrammer to single step the execution of a data flow program. Thedevelopment tool 522 pauses execution of the data flow program and waitsfor an indication from the programmer to perform a single step (steps3002 and 3004). When the development tool 522 receives the indication,the development tool 522 selects and executes code for the next node inthe queue (step 3006). Processing then stops and the programmer mayreview the results obtained by execution of the selected node.

With regard next to FIG. 31, that figure illustrates a flow diagram 3100of the steps performed by the development tool 522 when allowing theprogrammer to save and replay program execution information. Thedevelopment tool 522 pauses execution of the data flow program andoutputs DAG status information to secondary storage (e.g., a file)(steps 3102 and 3104). The DAG status information provides a history ofexecution of DAG nodes which the development tool 522 may use to replay(e.g., visually on a display) execution of nodes over time. To that end,the development tool 522 may save, as examples, the DAG structure, nodetimestamps of execution, breakpoints, thread identifications forexecuted nodes, dependency status, programmer selected step points,ordering of nodes in the queue, and the like as DAG status information.

Thus, when the development tool 522 receives a replay indication fromthe programmer, the development tool 522 loads DAG status informationfrom the secondary storage (steps 3106 and 3108). The development tool522 may then replay node execution (e.g., by presenting a visualrepresentation of a DAG over time) by highlighting (or displaying astext output) the execution of nodes in the DAG over time (step 3110).

With regard next to FIG. 32, that figure illustrates a flow diagram 3200of the steps performed by the development tool 522 when allowing theprogrammer to add or delete dependencies. The development tool 522pauses execution of the data flow program and receives an indication ofa dependency to add or delete (steps 3202 and 3204). For example, FIG.32 shows the programmer using a pointer to specify deletion ofdependency 3206 (from node (1,1) to node (1,2)), while adding adependency 3208 (from node (1,3) to node (1,2)).

In response, the development tool 522 adds or deletes the specifieddependencies and enqueues the blocks for processing (steps 3210 and3212). Execution continues using the newly added or removed dependencies(step 3214). Thus, the programmer, when faced with incorrect executionof a data flow program under development may investigate the cause ofthe problem, find that a dependency is missing, and add the dependency.Similarly, the programmer may find that a dependency is not in factnecessary and delete the dependency to investigate whether performanceimproves.

As noted above, the development tool also supports breakpoints. In oneimplementation, the development tool provides 1) one point, 2) noneafter, 3) all before, and 4) task node breakpoints specified on nodes. A“one point” breakpoint halts execution of the data flow program when thespecified node is selected for execution. A “none after” breakpointhalts execution when a thread selects for execution any node in the DAGafter the specified node. An “all before” breakpoint halts executionwhen all nodes before the specified node complete execution (note thatsome nodes after the specified node may also complete, depending on theorder of node execution). A “task node” breakpoint halts execution whena thread selects a node for execution that is associated with code thatperforms a designated task (e.g., a matrix multiplication). Breakpointsmay be used in combination on the same node, for example, a “one point”breakpoint may be used with a “none after” breakpoint or an “all before”breakpoint, or both.

With reference next to FIG. 33, that figure illustrates a flow diagram3300 of the steps performed by the development tool 522 when setting andchecking breakpoints. The development tool 522 receives a node andbreakpoint type indication, and in response sets the breakpoint for thenode (steps 3302 and 3304). Then, during execution of the data flowprogram, the development tool 522 monitors for breakpoint conditions tobe met (step 3306). When the development tool 522 determines that theconditions for any particular breakpoint are met, the development tool522 halts the data flow program (step 3308).

The development tool 522 may display the progress of the data flowprogram, including breakpoints to the programmer. For example, as shownin FIG. 34, the DAG 3400 illustrates that the programmer has selectednode (1,3) as a “one point” breakpoint. During execution, threads firstexecute nodes (1,1), (2,1), (3,1), and (4,1). A thread then selects andexecutes node (1,2). At this point, the specified breakpoint still hasnot been reached. However, assuming that the next thread selects node(1,3) for execution, the development tool 522 recognizes that the “onepoint” breakpoint has been reached, and halts execution of the data flowprogram. FIG. 35 shows the state of the DAG when the breakpoint isreached (with circular nodes representing executed nodes).

In one embodiment, the pseudocode ‘C’ structure shown in Table 1 may beused to represent a node in the DAG: TABLE 1 typedef structfinal_dag_node {  long doneflag; /* clear when node has been processed*/  long takenflag; /* set when claimed by a thread */  long process; /*process index */  long nregions; /* number of regions */  nodeRegion*regions; /* the regions for this node */  long numdepend; /* number ofdependency groups */  struct dependency_group *depend; /* pointers todependency group */  long recursion_level; /* level this node is at */ struct final_dag_node *parent; /* parent if in a subdag */  structfinal_dag_node *next; /* link to next node in the queue */  longendflag; /*set for nodes with no dependents */  long level; /* depth ofdag calls */  struct final_dag_node *preferred; /* link to the preffrednext node */  long pref_priority; /* the priority to assign to thepreferred node */ } FinalDagNode;

Note that the node structure includes the process (which identifies whattask to do), the data regions that will be acted on, the datadependencies which point at the nodes that are needed before this nodecan execute, and additional status fields.

An exemplary pseudocode ‘C’ structure shown in Table 2 may be used todefine data assigned to blocks: TABLE 2 typedef struct node_regions { long   ndims;   /* number of dimensions */ long   start[MAX_DIMENSIONS]; /* starting index */ long   end[MAX_DIMENSIONS]; /* ending index */ objectSize  *osize;  /*pointer to size object */ }nodeRegion;

Dependencies may be stored in groups as illustrated by the pseudocode‘C’ structure in Table 3. Each group may include an array of pointers tonodes that the node in question is dependent on. TABLE 3 typedef structdependency_group {  long   ndeps; /* number of dependencies */ FinalDagNode   **depend; /* pointers to nodes in dependencies */ struct dependency_group *next; /* link to next group in for the node*/} DependencyGroup;

Methods, systems, and articles of manufacture consistent with thepresent invention enable a programmer to easily develop data flowprograms and to convert existing control flow programs according to thedata flow model. By permitting programmers to define memory regions anddivide them into blocks with corresponding states (each related toparticular control flow program instructions), the development tool 522facilitates the development of a data flow program for execution in amultiprocessor environment.

The foregoing description of an implementation of the invention has beenpresented for purposes of illustration and description. It is notexhaustive and does not limit the invention to the precise formdisclosed. Modifications and variations are possible in light of theabove teachings or may be acquired from practicing of the invention. Forexample, the described implementation includes software but the presentinvention may be implemented as a combination of hardware and softwareor in hardware alone. The invention may be implemented with bothobject-oriented and non-object-oriented programming systems. The claimsand their equivalents define the scope of the invention.

1. A method in a data processing system for developing a data flowprogram comprising nodes, the method comprising the steps of: initiatingexecution of the data flow program; and executing a debugging command onthe data flow program.
 2. A method according to claim 1, wherein thestep of initiating execution comprises the steps of determining the datadependencies between the nodes and enqueueing the nodes in accordancewith the data dependencies.
 3. A method according to claim 1, whereinthe step of executing a debugging command comprises the step ofexecuting a breakpoint debugging command.
 4. A method according to claim1, wherein the step of executing a debugging command comprises the stepof executing a dependency modification debugging command.
 5. A methodaccording to claim 1, wherein the step of executing a debugging commandcomprises the step of executing a step debugging command.
 6. A methodaccording to claim 1, wherein the step of executing a debugging commandcomprises the step of executing a replay debugging command.